home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 4 / The 640 Meg Shareware Studio CD-ROM Volume IV (Data Express)(1994).ISO / wp / b1ff_wun.zip / B1FF.L < prev    next >
Text File  |  1993-06-10  |  9KB  |  245 lines

  1. %{
  2. /*
  3.  
  4. For the information of some:
  5.  
  6. B1FF is a fictitious person who is "new" on the 'net.
  7.  
  8. You can recognize his posts by:
  9.  
  10.   He always SHOUTS as he types.
  11.  
  12.   He sometimes spells FONET1KLEE (phonetically) the rest of the time, he  
  13.     just misspells words or punctuates them incorrectly.
  14.  
  15.   He shortens some words (presumably for ease in typing)
  16.    like '4' for 'for' or 'four'
  17.    like '2' for 'two' or 'to' or 'too'
  18.    like '&' for 'and'
  19.    like 'U' for 'you' or 'ewe'
  20.    like 'R' for 'are'
  21.    like 'C' for 'sea' or 'see'
  22.   
  23. He can't see the difference between certain letters
  24.        like '1' and 'i'
  25.     or like '0' and 'o'
  26.     or like '5' and 's'
  27.     or like '2' and 'z'
  28.  
  29.   His speech is peppered with profanity.
  30.  
  31.   He never uses only one '!' or '?' when '!!!!!!!!' or '????!!!!' will do.
  32.  
  33.   He never uses the apostrophe (') and always uses the double quote (")
  34.      instead.
  35.  
  36.   I have some vague memory of B1FF being mentioned in the New Hackers
  37. dictionary, but I can't verify the validity of this.
  38.  
  39.   I can't even validate that his full name is NELSON 0TB1FF , but it sounds
  40. correct.
  41. */
  42.  
  43. /*
  44. Here's the promised and long-awaited 'b1ff.x' English->B1FF converter
  45. that everyone's been clamoring for. I made a few small changes since the
  46. last version and made sure that it compiled correctly.
  47.  
  48. To compile this, save it to the file 'b1ff.x' and execute the following
  49. two commands:
  50.        lex b1ff.x
  51.        cc -o B1ff lex.yy.c -ll
  52.  
  53. Note that the flags on cc should be in that order. You'll end up with the
  54. executable 'B1ff' (if you call it 'biff' with a lowercase 'b' you'll
  55. conflict with the biff mail-checking program). 
  56.  
  57. Send me any bugs or patches; I'm good friends with B1FF and since this is 
  58. the first program he's ever posted to the net, he wants to know if you
  59. have any problems. 
  60.  
  61. mdw
  62. */
  63.  /* 
  64.   * B1FF.X by Matt Welsh (mdw@tc.cornell.edu) +1 607 253 2737
  65.   *  modified and improved by David Whitten 
  66.   *
  67.   * $Id: b1ff.x,v 1.1 92/11/03 18:31:10 mdw Exp Locker: mdw $
  68.   * $What: <@(#) b1ff.x,v      1.13> $
  69.   *
  70.   * Simulates our favorite guy, the B1FFSTER!!!!1!!!
  71.   *
  72.   * To compile, do the following:
  73.   *
  74.   *   lex b1ff.x
  75.   *   cc -o B1ff lex.yy.c -ll
  76.   *
  77.   * Yes, this is very poorly written, and yes, it was a late-night hack.
  78.   * But it seems to work, mail me if it doesn't compile, or if you find 
  79.   * any bugs or make any additions.
  80.   * Happy B1FFing,
  81.   * 
  82.   * mdw
  83.   * 
  84.   */
  85.  
  86.     char buf[128];
  87. %}
  88.  
  89.  
  90. BW [   ]
  91. EW [   .,;!?]
  92. WC             [A-Za-z']
  93. NW             [^A-Za-z']
  94.  
  95. %start         INW NIW 
  96. %e 3000
  97. %p 6000
  98. %n 1000
  99. %k 500
  100. %a 4000
  101. %o 15000
  102.  
  103. %%
  104.  
  105. \\[^ \n]+      ECHO;
  106.  
  107. {NW}           { BEGIN NIW; ECHO; }
  108. "..."           { BEGIN NIW;
  109.                        printf((rand()%2) ? "...C00L HUH!?! " : "...!! "); }
  110. "."/{NW}       { BEGIN NIW; printf((rand()%2) ? "." : "!!" ); }
  111. ".\""           { BEGIN NIW; printf((rand()%2) ? "!!!\"" : "!1!!\"" ); }
  112. "!"$            { BEGIN NIW; printf("!!!!!!!!!!1"); }
  113. "!"+/{NW}       { BEGIN NIW; printf("!1!"); }
  114. "?"/{NW}        { BEGIN NIW; printf("??!!"); }
  115. "?"             { BEGIN NIW; printf("?!");  }
  116. ":)"            { BEGIN NIW; printf(";-)!!! "); }
  117. "8)"            { BEGIN NIW; printf(";-)!!! "); }
  118. ":*)"           { BEGIN NIW; printf(";-)!!!!  "); }
  119. ":-)"           { BEGIN NIW; printf(";-)!!!!  "); }
  120. "'"             { BEGIN NIW; printf("\""); }
  121.  
  122. "ove"           { BEGIN INW; printf("UV "); }
  123. "move"         { BEGIN INW; printf("MOOV"); }
  124. "ea"            { BEGIN INW; printf("EE"); }
  125. "ies"           { BEGIN INW; printf("YS"); }
  126. "please"        { BEGIN INW; printf("PLEEZ!"); }
  127. "Please"        { BEGIN INW; printf("PLEEZ"); }
  128. "Thanks"        { BEGIN INW; printf("THANX!!"); }
  129. "thanks"        { BEGIN INW; printf("THANX"); }
  130. "enough"        { BEGIN INW; printf("ENUF"); }
  131. "Enough"        { BEGIN INW; printf("ENUFF"); }
  132. "does"          { BEGIN INW; printf("DUZ"); }
  133. "Does"          { BEGIN INW; printf("DUZ"); }
  134. "fuck"/{NW}     { BEGIN INW; printf("FUCK !!!!!1 "); }
  135. "Fuck"/{NW}     { BEGIN INW; printf("FUCK !!!!!1 "); }
  136. "damn"          { BEGIN INW; printf("FUCK!! "); }
  137. <NIW>"hell"/{NW}          { BEGIN INW; printf("FUCK!! "); }
  138. "Damn"          { BEGIN INW; printf("FUCK!! "); }
  139. "Shit"          { BEGIN INW; printf("FUCK!! "); }
  140. "shit"          { BEGIN INW; printf("FUCK!! "); }
  141. <NIW>"Hell"/{NW}          { BEGIN INW; printf("FUCK!! "); }
  142. <NIW>"dick"/{NW}          { BEGIN INW; printf("FUCK!! "); }
  143. <NIW>"Dick"/{NW}          { BEGIN INW; printf("FUCK!! "); }
  144. <NIW>"mad"/{NW} { BEGIN INW; printf("PISSED 0FF!!!1! "); }
  145. <NIW>"Mad"/{NW} { BEGIN INW; printf("PISSED 0FF!!!1! "); }
  146. "ar"/{NW}       { BEGIN NIW; printf("RE"); }
  147. "are"/{NW}      { BEGIN INW; printf("R"); }
  148. "ain"/{NW}      { BEGIN NIW; printf("ANE"); }
  149. "before"/{NW}  { BEGIN NIW; printf("B4");}
  150. "for"/{NW}     |
  151. "fore"/{NW}    { BEGIN NIW; printf("4");}
  152. "four"/{NW}    { BEGIN NIW; printf("FORE ");}
  153. "sea"/{NW}     |
  154. "see"/{NW}     { BEGIN NIW; printf("C ");}
  155. "to"/{NW}       |
  156. "too"/{NW}      { BEGIN NIW; printf("2"); }
  157. "two"/{NW}      { BEGIN NIW; printf("TO "); }
  158. "one"/{NW}      { BEGIN NIW; printf("1"); }
  159. <INW>"ould"/{NW} {BEGIN NIW; printf("UD ");}
  160. "ic"/{NW}       { BEGIN NIW; printf("IK"); }
  161. "le"/{NW}       { BEGIN NIW; printf("EL"); }
  162. "by"/{NW}       { BEGIN NIW; printf("BUY"); }
  163. "buy"/{NW}      { BEGIN NIW; printf("BY"); }
  164. "bye"/{NW}      { BEGIN NIW; printf("BY"); }
  165. "e"/{NW}        { BEGIN NIW;
  166.                         printf((rand()%2) ? "E" : (rand()%2 ? "E" : "3");}
  167. "ewe"          |
  168. "you"           { BEGIN INW; printf("U"); }
  169. "your"          { BEGIN INW; printf("YOU'RE"); }
  170. "there"         { BEGIN INW; printf("THARE"); }
  171. "they're"       { BEGIN INW; printf("THARE"); }
  172. "cause"         { BEGIN INW; printf("CUZ"); }
  173. <INW>"or"       { BEGIN INW; printf((rand()%2) ? "OR" : "ER"); }
  174. "and"           { BEGIN INW; printf("&"); }
  175. "biff"          { BEGIN INW; printf("B1FFSTER!!!!!"); }
  176. "BIFF"          { BEGIN INW; printf("B1FFSTERE!!!1!"); }
  177. "Biff"          { BEGIN INW; printf("B1FFSTERE!!!1!"); }
  178. "tion"          { BEGIN INW; printf("SHUN"); }
  179. "good"         |
  180. "cool"          { BEGIN INW; printf("C00L!!!"); }
  181. "computer"      { BEGIN INW; printf("C-64"); }
  182. "software"      { BEGIN INW; printf("WAREZ!1!!"); }
  183. "program"       { BEGIN INW; printf("WAREZ!1!!"); }
  184. "gal"          |
  185. "girl"         |
  186. "woman"                { BEGIN INW; printf("BAB3"); }
  187. "boy"          |
  188. "dude"         |
  189. "Mr"            |
  190. "man"/{NW}      |
  191. "Man"          { BEGIN INW; printf("D00D"); }
  192. "some"          { BEGIN INW; printf("SUM"); }
  193.  
  194. "a"             { BEGIN INW; printf("A"); }
  195. "b"             { BEGIN INW; printf("B"); }
  196. "c"             { BEGIN INW; printf("C"); }
  197. "d"             { BEGIN INW; printf("D"); }
  198. "e"             { BEGIN INW; printf("E"); }
  199. "f"             { BEGIN INW; printf("F"); }
  200. "g"             { BEGIN INW; printf("G"); }
  201. "h"             { BEGIN INW; printf("H"); }
  202. "i"             { BEGIN INW; printf((rand()%2) ? "I" : "1"); }
  203. "I"             { BEGIN INW; printf((rand()%2) ? "I" : "1"); }
  204. "j"             { BEGIN INW; printf("J"); }
  205. "k"             { BEGIN INW; printf("K"); }
  206. "l"             { BEGIN INW; printf("L"); }
  207. "ll"            { BEGIN INW;
  208.                         printf((rand()%2) ? "LL" : (rand()%2 ? "L" : "LLL");}
  209. "m"             { BEGIN INW; printf("M"); }
  210. "n"             { BEGIN INW; printf("N"); }
  211. "nn"            { BEGIN INW;
  212.                         printf((rand()%2) ? "NN" : (rand()%2 ? "N" : "NNN");}
  213. "o"             { BEGIN INW; printf("0"); }
  214. "oo"            { BEGIN INW; 
  215.                          printf((rand()%2) ? "00" : "UU"); }
  216. "O"            { BEGIN INW; printf("0"); }
  217. "OO"            { BEGIN INW; 
  218.                          printf((rand()%2) ? "00" : "UU"); }
  219. "ph"            { BEGIN INW; printf("F"); }
  220. "Ph"            { BEGIN INW; printf("F"); }
  221. "p"             { BEGIN INW; printf("P"); }
  222. "q"             { BEGIN INW; printf("Q"); }
  223. "r"             { BEGIN INW; printf("R"); }
  224. "s"             { BEGIN INW; printf((rand()%2) ? "5" : "S"); }
  225. "S"             { BEGIN INW; printf((rand()%2) ? "5" : "S"); }
  226. "t"             { BEGIN INW; printf("T"); }
  227. "u"             { BEGIN INW; printf("U"); }
  228. "v"             { BEGIN INW; printf("V"); }
  229. "w"             { BEGIN INW; printf("W"); }
  230. "x"             { BEGIN INW; printf("X"); }
  231. "y"             { BEGIN INW; printf("Y"); }
  232. "z"             { BEGIN INW; printf((rand()%2) ? "2" : "Z"); }
  233. .              printf(yytext);
  234. \n             printf("\n");
  235. .              { BEGIN INW; ECHO; }
  236.  
  237. %%
  238.  
  239. main()
  240. {
  241.        srand(getpid());
  242.        yylex();
  243.        return(0);
  244. }
  245.